<html>
<title>ws test</title>
<!-- Jquery Core Js -->
<script src="/styles/plugins/jquery/jquery.min.js"></script>
<body>
	<input name="username" value="" type="text">
	<button id="connect">connect</button>
	<button id="disconnect">disconnect</button>

</body>
<script>
	
    var websocket = null;
    if ('WebSocket' in window) {
        websocket = new WebSocket("ws://localhost:8080/websocket/socketServer");
    } 
    else if ('MozWebSocket' in window) {
        websocket = new MozWebSocket("ws://localhost:8080/websocket/socketServer");
    } 
    else {
        websocket = new SockJS("http://localhost:8080/sockjs/socketServer");
    }
    websocket.onopen = function() {
        console.log("open");
    };
    websocket.onmessage = function (txt) {
        console.log(txt);
	};
    $("#connect").click(function(){
        websocket.send("hello");
    });
    $("#disconnect").click(function(){
        websocket.close();
    });



</script>

</html>